import Service from "@/utils/request";

class Reqhome extends Service {
  reqCategory(time: any) {
    return this.get({ url: `https://m.you.163.com/xhr/index.json?__timestamp=${time}` })
  }
  reqItem(time: any) {
    return this.get({ url: `https://m.you.163.com/item/cateList.json?__timestamp=${time}` })
  }
  reqCateitem(time: any, categoryId: any) {
    return this.get({ url: `https://m.you.163.com/item/list.json?__timestamp=${time}&categoryId=${categoryId}` })
  }
  reqCatelists(time: any) {
    return this.get({ url: `https://m.you.163.com/item/cateList.json?__timestamp=${time}` })
  }
  reqCatelist(time: any, categoryId: any) {
    return this.get({ url: `https://m.you.163.com/item/cateList.json?__timestamp=${time}&categoryId=${categoryId}` })
  }
  reqWaterfall(page: any, size: any) {
    return this.get({ url: `https://m.you.163.com/topic/v1/find/recAuto.json?page=${page}&size=${size}` })
  }
  reqLogin(data: any) {
    return this.post({ url: `http://gmall-h5-api.atguigu.cn/api/user/passport/login`, data })
  }
  reqHotsearch() {
    return this.get({ url: `https://m.you.163.com/xhr/search/init.json` })
  }
  reqSearchAuto(keywordPrefix: any) {
    return this.post({ url: `https://m.you.163.com/xhr/search/searchAutoComplete.json?keywordPrefix=${keywordPrefix}` })
  }
}

export default new Reqhome